package com.atgm.mall.gmmailware.exception;

import com.atgm.common.exception.OrderException;
import com.atgm.common.exception.WareException;
import com.atgm.common.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class WareExceptionHandler {

    @ExceptionHandler(WareException.class)
    public R handlerOrderException(OrderException e) {
        return R.error(e.getCode(), e.getMsg());
    }
}
